package org.jacoco.core.instr;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class MyTest {
    public String say(){
        int a = 0;
        int b=1,c=2;
        if(a == 0){
            System.out.println(1);
        }else{
            System.out.println(2);
        }
        switch (a){
            case 0:
                System.out.println(0);
                break;
            case 1:
                System.out.println(1);
                break;
            default:
                System.out.println(-1);
        }
        try{
            int d = 1/0;
        }catch (ArithmeticException e){
            System.out.println(0);
        }catch (Exception e){
            System.out.println(1);
        }
        Runnable r = () -> {
            System.out.println("Hello");
            System.out.println("world");
            System.out.println("!");
        };
        List list = new ArrayList<>();
        list.add(1);
        list.stream()
                .filter(item->{
                    if(item !=null){
                        System.out.println("this is true");
                        return true;
                    }else{
                        System.out.println("this is false");
                        return false;
                    }
                })
                .collect(Collectors.toList());
        return "xxx";
    }
}